<?php

session_start();

function myHeader($menu_actif){
?>
<html>
	<head>
		<meta charset="UTF-8">
		<link href="css/bootstrap.css" rel="stylesheet"/>
		<link href="css/datepicker.css" rel="stylesheet"/>

		<style> 
		   body{
			font-size: 12px; 
		   }
		   #footer {
				background-color: #f5f5f5;
		   }
		   .hero-unit{
			font-size: 12px; 
			padding:10px;
		   }
		   #body{
			margin-top:170px;
			}	
		   .navbar .dropdown-menu:before {
			content:normal;
			}
		   select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input  {
			 height:30px;
		   }
		</style>

		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/script.js"></script>
		<script type="text/javascript" src="js/bootstrap-datepicker.js"></script>
	</head>
<body> 
   <div class="navbar">
		<div class="navbar-inner">
			 <a class="brand" href="#">ENSIIE</a>
			 <ul class="nav">
				 <li <?php if($menu_actif=='enseignements'){echo 'class="active"';} ?>><a href="enseignement.php">Enseignements</a></li>
				 <li <?php if($menu_actif=='enseignants'){echo 'class="active"';} ?>><a href="enseignant.php">Enseignants</a></li>
				</ul>
			 <form class="navbar-form pull-right">
				<button class="btn btn-mini btn-primary" type="button" onclick="menu_info();">Compte</button>
			 </form>
		</div>
   	</div>
	<div id="info" class="hero-unit" style="position:absolute;right:20">
		<?php require_once('login.php'); ?>
	</div>
	
	<?php 
		if(isset($_GET['error']) && $_GET['error']=='1' && !isset($_GET['success'])) {
			echo '
				<div class="alert alert-error span5 pull-right">
					<button type="button" class="close" data-dismiss="alert">&times;</button>
					<h4>Erreur !</h4>
					Impossible de vous connecter. Veuillez vérifier vos identifiants.
				</div>';
		} 
		

		if(isset($_SESSION['id']) && !empty($_SESSION['id']) &&
			isset($_GET['success']) && $_GET['success']=='1' && !isset($_GET['error'])) {
			echo '
				<div class="alert alert-success span5 pull-right">
					<button type="button" class="close" data-dismiss="alert">&times;</button>
					<h4>Bienvenue '.$_SESSION['prenom'].' '.$_SESSION['nom'].' !</h4>
					La connexion à votre compte a réussi.
				</div>';
		}
		
	?>
    </div>
<?php	  
}
?>
